package com.arcbbs.mapper;

import com.arcbbs.entity.ForumArticle;
import com.arcbbs.entity.ForumArticleAttachment;
import com.arcbbs.entity.ForumArticleQuery;
import com.github.pagehelper.Page;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface FormArticleMapper {
    Page<ForumArticle> page1(ForumArticleQuery forumArticleQuery);

//    Page<ForumArticle> page4(ForumArticleQuery forumArticleQuery);
//
//    Page<ForumArticle> page2(ForumArticleQuery forumArticleQuery);
//
//    Page<ForumArticle> page3(ForumArticleQuery forumArticleQuery);

    @Select("select * from forum_article where article_id=#{articleId}")
    ForumArticle getbyid(String articleId);

    void updateArticleNumber(Integer updateType, Integer changeCount,String articleId);

    void insert(ForumArticle forumArticle);

    void updateByarticleId(ForumArticleAttachment uploadinfo, String fileId);

    void updateByarticleId1(ForumArticle forumArticle, String articleId);
@Select("select  count(*) from forum_article where  user_id =#{userId} and status = #{i}")
    Integer selectbycount(String userId, int i);
}
